package practice;

import java.util.Scanner;

public class QualityFactor {
    public static void main(String[] args) {
        PrintQualityFactor();
    }
    public static void PrintQualityFactor() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = 2;
        while(n != 1){
            if(Prime(k)){
                if(n % k == 0) {
                    n /= k;
                    System.out.print(k +" ");
                } else {
                    k++;
                }
            } else {
                k++;
            }
        }
    }
    public static boolean Prime(int t) {
        boolean x = true;
        for(int j = 2;j * j <= t;j++){
            if(t % j == 0) {
                x = false;
                break;
            }
        }
        return x;
    }
}
